package com.zygh.policeasset.mapper;

import com.zygh.policeasset.pojo.PurchaseTender;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.type.JdbcType;

@Mapper
/* loaded from: police-asset-2.0-0.0.1-SNAPSHOT.jar:BOOT-INF/classes/com/zygh/policeasset/mapper/purchaseTenderMapper.class */
public interface purchaseTenderMapper {
    @Select({"select *  from purchase_tender where id = #{id}"})
    @ResultMap({"purchaseTenderMap"})
    PurchaseTender queryById(Integer num);

    @Select({"select *  from purchase_tender where purchase_type = #{type} and status = #{status}"})
    @Results(id = "purchaseTenderMap", value = {@Result(column = "id", property = "id", jdbcType = JdbcType.INTEGER, id = true), @Result(column = "tender_num", property = "tenderNum", jdbcType = JdbcType.VARCHAR), @Result(column = "application_unit", property = "applicationUnit", jdbcType = JdbcType.VARCHAR), @Result(column = "tender_method", property = "tenderMethod", jdbcType = JdbcType.VARCHAR), @Result(column = "design_unit", property = "designUnit", jdbcType = JdbcType.VARCHAR), @Result(column = "drawing_number", property = "drawingNumber", jdbcType = JdbcType.VARCHAR), @Result(column = "budget_price", property = "budgetPrice", jdbcType = JdbcType.VARCHAR), @Result(column = "sources_of_funds", property = "sourcesOfFunds", jdbcType = JdbcType.VARCHAR), @Result(column = "start_time", property = "startTime", jdbcType = JdbcType.VARCHAR), @Result(column = "purchase_type", property = "purchaseType", jdbcType = JdbcType.VARCHAR)})
    List<PurchaseTender> queryAll(@Param("type") String str, @Param("status") Integer num);

    @Insert({"insert into purchase_tender (tender_num,application_unit,tender_method,design_unit,drawing_number,budget_price,sources_of_funds,undertaker,unit,start_time,status,purchase_type) values(#{tenderNum},#{applicationUnit},#{tenderMethod},#{designUnit},#{drawingNumber},#{budgetPrice},#{sourcesOfFunds},#{undertaker},#{unit},#{startTime},#{status},#{purchaseType})"})
    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    int add(PurchaseTender purchaseTender);

    @Update({"update purchase_tender set tender_num = #{tenderNum},application_unit = #{applicationUnit},tender_method = #{tenderMethod},design_unit = #{designUnit},drawing_number = #{drawingNumber},budget_price = #{budgetPrice},sources_of_funds = #{sourcesOfFunds},undertaker = #{undertaker},unit = #{unit},start_time = #{startTime},purchase_type = #{purchaseType} where id = #{id}"})
    int update(PurchaseTender purchaseTender);

    @Delete({"delete from purchase_tender where id = #{id}"})
    int deleteById(Integer num);

    @Update({"update purchase_tender set status = #{status} where id = #{id}"})
    int updateByid(@Param("id") Integer num, @Param("status") Integer num2);
}